@charset "UTF-8";

// 设置高清图片
// 测试: http://www.sassmeister.com/gist/655429b4a48f60e1b67cbac8b1570a81
@mixin retina-image($filename, $extension, $background-size: null, $retina-suffixs: _2x _3x) {
  background-image: url("#{$filename}.#{$extension}");
  @if $background-size {
    background-size: $background-size;
    @if $retina-suffixs {
      @each $suffix in $retina-suffixs {
        $dpr: null;

        @if $suffix == _2x {
          $dpr: '.dpr2';
        } @else if $suffix == _3x {
          $dpr: '.dpr3';
        }

        @if $dpr {
          #{$dpr} & {
            background-image: url("#{$filename}#{$suffix}.#{$extension}");
          }
        }
      }
    }
  }
}

@mixin bg-image($filename,$extension,$background-size:null) {
  background-image: url("#{$filename}@2x.#{$extension}");
  @media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
    & {
      background-image: url("#{$filename}@3x.#{$extension}");
    }
  }
}
